﻿namespace NXIDAL
{
    public interface IbaseDAL<T> where T : class
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="t">泛型</param>
        /// <returns>受影响的行数</returns>
        Task<int> AddAsync(T t);
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        Task<int> AddRanzeAsync(List<T> list);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="t">泛型</param>
        /// <returns>受影响的行数</returns>
        Task<int> DeleteAsync(T t);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        Task<int> DelteRanzeAsync(List<T> list);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t">泛型</param>
        /// <returns>受影响的行数</returns>
        Task<int> UnpateAsync(T t);
        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        Task<int> UnpateRanzeAsync(List<T> list);
        /// <summary>
        /// 延迟查询
        /// </summary>
        /// <returns></returns>
        IQueryable<T> GetAllAsync();
    }
}
